﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ActionLogic
{
    public class PriorityAction : IComparable<PriorityAction>
    {
        public Action Execute { get; private set; }

        public double Priority { get; private set; }

        public bool IsBackground { get; private set; }

        public PriorityAction(Action execute, double priority, bool isBackground)
        {
            Execute = execute;
            Priority = priority;
            IsBackground = isBackground;
        }

        public int CompareTo(PriorityAction other)
        {
            return this.Priority.CompareTo(other.Priority);
        }
    }
}
